package org.jeecg.modules.tt_question_collect.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.tt_question_collect.entity.TtCollectFlow;

import java.util.List;

/**
 * @Description: 审批流程表
 * @Author: jeecg-boot
 * @Date: 2021-02-02
 * @Version: V1.0
 */
public interface TtCollectFlowMapper extends BaseMapper<TtCollectFlow> {

    @Select("select * from tt_collect_flow")
    List<TtCollectFlow> queryttcollectflowlist();

    @Delete("delete from tt_collect_flow_node where flowcode = ${flowcode}")
    void delbyflowcode(String flowcode);

    @Select("select id,username,realname from sys_user where dbms_lob.instr(depart_ids, '${dept}' ,1 ,1) <> 0 and status = '1' and del_flag = '0'")
    List<SysUser> queryUserListByDeptId(String dept);

    @Select("select flowcode from tt_collect_flow where flowname = '方案审批流程'")
	String getbyname(String flowCode);
    
    @Select("select count(0) from tt_collect_flow where flowtype ='fasplc'")
	int queryfacount();
}
